import request from '@/utils/request'

// 创建培训计划
export function createTrainingPlan(data) {
  return request({
    url: '/biz/training-plan/create',
    method: 'post',
    data: data
  })
}

// 更新培训计划
export function updateTrainingPlan(data) {
  return request({
    url: '/biz/training-plan/update',
    method: 'put',
    data: data
  })
}

// 删除培训计划
export function deleteTrainingPlan(id) {
  return request({
    url: '/biz/training-plan/delete?id=' + id,
    method: 'delete'
  })
}

// 获得培训计划
export function getTrainingPlan(id) {
  return request({
    url: '/biz/training-plan/get?id=' + id,
    method: 'get'
  })
}

// 获得培训计划分页
export function getTrainingPlanPage(query) {
  return request({
    url: '/biz/training-plan/page',
    method: 'get',
    params: query
  })
}

// 导出培训计划 Excel
export function exportTrainingPlanExcel(query) {
  return request({
    url: '/biz/training-plan/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
